package com.bw.biz.listener;

import com.bw.biz.service.TbBillService;
import com.bw.biz.service.TbOrderService;
import com.bw.core.result.ResponseResult;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class RiskResultListener {
    @Autowired
    private TbOrderService service;
    @Autowired
    private TbBillService billService;
    //监听 风控MQ
    @RabbitListener(queues = "item_cheng")
    public void receiveMsg(String msg){

        service.dispose(msg);
    }

    //生成账单，还款计划
    @RabbitListener(queues = "item_plan")
    public void generateBillMsg(String msg){
        service.generateBill(msg);
    }

    //通知用户该还款了
    @RabbitListener(queues = "item_repay")
    public void repayment(String msg){
        System.out.println(msg);
//        billService.repayment(msg);
    }
}